<!--
 * @Author: White
 * @description: 搜索列表
 * @LastEditTime: 2021-10-20 22:55:35
-->

<template>
    <div class="search-main">
        <div class="search-wrap" v-for="(item, index) in list" :key="index">
            <div class="search-item">{{item.first}}</div>
        </div>
    </div>
</template>

<script>
import { onMounted, reactive, toRefs } from 'vue'
import { getSearchHot, getSearchLsit } from '@/api/music'
export default {
    setup () {
        const state = reactive({
            list: []
        })
        onMounted(async () => {
            const res = await getSearchHot()
            if (res.data.code === 200) {
                state.list = res.data.result.hots
            }
        })
        return {
            ...toRefs(state)
        }
    }
}
</script>

<style lang="scss" scoped>
.search-main {
    width: 200px;
    background-color: #fff;
    color: red;
}
</style>